package operation;

import book.BookList;

import java.util.Scanner;

public class FindOperation implements IOPeration{

    public void work(BookList bookList){
        System.out.println("查找图书!");
        System.out.println("请输入要查找的书的书名");
        Scanner in = new Scanner(System.in);
        String obj = in.nextLine();
        for (int i = 0; i < bookList.getUsedSize(); i++) {
            if(bookList.getPos(i).getName().equals(obj)){
                System.out.println("找到了，信息如下："+bookList.getPos(i));
                return;
            }
        }
        System.out.println("没有这本书");
    }
}
